package com.juc.semaphore.semaphore10;

import java.util.concurrent.Semaphore;

public class MyServiceNoFair {

    private boolean  isFair = false;

    private Semaphore semaphore = new Semaphore(1,isFair);

    public void testMethod() {
        try {
            semaphore.acquire();
            System.out.println(" threadName " + Thread.currentThread().getName());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }finally {
            semaphore.release();
        }
    }



}
